import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/pages/Home/'),
    meta:{footerShow:true}
  },
  {
    path:'/search/:keyword?',
    name:'search',
    component: () => import('@/pages/Search/'),
    meta:{footerShow:true}
  },
  {
    path:'/login',
    name:'login',
    component: () => import('@/pages/Login/'),
    meta:{footerShow:false}
  },
  {
    path:'/register',
    name:'register',
    component: () => import('@/pages/Register/'),
    meta:{footerShow:false}
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
